﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Search.aspx.cs" Inherits="DemoPersonalizeSearch.Search" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 850px;
        }
        .style_search_textbox
        {
            float: left;
        }
        .style_search_textbox1
        {
            float: right;
        }
        .default_hide
        {
            display: none;
        }
        .invisible
        {
            display: none;
        }
        
        #options li
        {
            list-style-type: none;
            margin: 0px 10px 10px 0;
            vertical-align: top;
        }
        #options
        {
            padding-left: 5px;
            position:relative;
        }
        .updowntextbox
        {
            margin-top: 0px;
        }
        .style2
        {
            width: 100%;
        }
        .updown 
        {
            vertical-align:top;
            
            }
        .updown div 
        {
           
            float:left;
            left:150px;
            }
    </style>
    <script type="text/javascript" language="javascript" src="Scripts/jquery-1.9.1.min.js"></script>
    <script type="text/javascript">
        function clickButton(e, buttonid) {
            var evt = e ? e : window.event;
            var bt = document.getElementById(buttonid);
            if (bt) {
                if (evt.keyCode == 13) {
                    bt.click();
                    return false;
                }
            }
        }
        function inform() {
            //alert($("#pnInform").attr("visibility"));
            $("#pnInform").fadeIn("fast").delay(1500).fadeOut("slow");


        }
        $(document).ready(function () {
            $("#BtnOptions").click(function () {
                //alert($("#pnOptions").attr("display"));
                if ($("#pnOptions").attr("display") == "inline-block") {
                    $("#pnOptions").hide("slow");
                    $("#pnOptions").attr("display", "none");

                    $("#imgUpDown").attr("src", "images/down.gif");

                } else {
                    $("#pnOptions").show("slow");
                    $("#pnOptions").attr("display", "block");
                    $("#imgUpDown").attr("src", "images/up.gif");

                }
                //alert($("#pnOptions").attr("src"));

            });
            $("#imgUpDown").click(function () {
                //alert($("#pnOptions").attr("display"));
                if ($("#pnOptions").attr("display") == "block") {
                    $("#pnOptions").hide("slow");
                    $("#pnOptions").attr("display", "none");

                    $("#imgUpDown").attr("src", "images/down.gif");

                } else {
                    $("#pnOptions").show("slow");
                    $("#pnOptions").attr("display", "block");
                    $("#imgUpDown").attr("src", "images/up.gif");

                }
                //alert($("#pnOptions").attr("src"));

            });
        });

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager runat="server">
    </asp:ScriptManager>
  
            <table width="1024px;" align="center">
            <tr>
            <td colspan="2" style="padding-left:100px;">
               <h1 style="color: #0000FF">
            Personalize Search Demo</h1>
            </td>
            </tr>
            <tr>
            <td style="width:150px;vertical-align:top;padding-top:70px">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                <ContentTemplate>
                
               
              <asp:BulletedList ID="blExpansion" runat="server" style="margin-left:5px;list-style-type:none;" 
            DisplayMode="LinkButton" BulletStyle="Disc" Font-Names="arial" Font-Size="Large" 
                    onclick="blExpansion_Click">

            </asp:BulletedList>
             </ContentTemplate>
                </asp:UpdatePanel>
            <div></div>
            </td>
            <td style="vertical-align: top;"> 
            <div style="vertical-align: top;width:900px">
       
        <div style="width: 200px; height: 120px; float: right; margin-top: -60px; text-align: right;
            margin-right: 10px;">
            <asp:Panel ID="Panel1" runat="server">
                <asp:TextBox ID="txtUsername" runat="server" Height="25px" Width="180px" TabIndex="2"></asp:TextBox>
                <asp:HyperLink ID="lblUsername" runat="server" Font-Bold="True" Font-Size="Large"
                    NavigateUrl="~/TagClouds.aspx" Target="_self">[lblUsername]</asp:HyperLink>
            </asp:Panel>
            <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
            <br />
            <asp:Button ID="btnSignIn" runat="server" Height="25px" Text="Sign In" Width="60px"
                OnClick="btnSignIn_Click" TabIndex="3" /><br />
            <p class="style_search_textbox1">
                <a href="#" style="text-decoration: none;">
                    <asp:Label ID="BtnOptions" runat="server" Font-Bold="True" ForeColor="#666666" Text="Options"></asp:Label>
                    <asp:Image ID="imgUpDown" runat="server" Height="9px" Width="25px" AlternateText="NoIMG"
                        ImageUrl="~/images/down.gif" />
                </a>
            </p>
        </div>
       
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
           
            <asp:TextBox ID="txtQuery" runat="server" Height="30px" Width="307px" CssClass="style_search_textbox"
                Font-Size="14pt"></asp:TextBox>
                 </ContentTemplate>
                 <Triggers>
                 <asp:AsyncPostBackTrigger ControlID="blExpansion" EventName="click" />
                 </Triggers>
            </asp:UpdatePanel>
            &nbsp;
            <asp:ImageButton ID="btnSearch" runat="server" Height="38px" ImageUrl="~/images/button_search.jpg"
                OnClick="BtnSearch_Click" TabIndex="1" />
       
        <p>
          
        </p>
        <div>
            <asp:Panel ID="pnInform" runat="server" CssClass="style_search_textbox invisible"
                Height="21px">
                &nbsp; &nbsp;<asp:Image ID="Image2" runat="server" Height="20px" ImageUrl="~/images/check_mark_green.gif"
                    Width="20px" />
                <asp:Label ID="Label2" runat="server" Text="Saved"></asp:Label>
            </asp:Panel>
        </div>
        <p style="height: 5px;">
        </p>
        <asp:Panel ID="pnOptions" runat="server" Width="900px" BorderColor="#666666" BorderWidth="1px"
            CssClass="default_hide">
            <div style="text-align: left; background-color: #CCCCCC; padding-top: 3px; margin-top: 0px;
                height: 35px;">
                &nbsp;&nbsp;<asp:Button ID="BtnSave" runat="server" Text="Save" Height="28px" Width="100px"
                    OnClick="BtnSave_Click" CssClass="style_search_textbox" />
            </div>
            <table cellspacing="5" class="style2">
                <tr>
                    <td>
                        <asp:CheckBox ID="ckCache" runat="server" EnableViewState="False" Font-Bold="False"
                            Font-Names="Arial" Font-Size="13pt" ForeColor="#3366FF" Text="Store Search Result" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:CheckBox ID="ckIsPersonal" runat="server" EnableViewState="False" Font-Bold="False"
                            Font-Names="Arial" Font-Size="13pt" ForeColor="#3366FF" Text="Is Persionalize Search" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="updown">
                        <asp:Label ID="Label4" runat="server" Text="Max result get:" 
                            CssClass="updowntextbox" Font-Size="Large" Font-Bold="True"></asp:Label><asp:TextBox ID="txtMaxResult" runat="server" Font-Bold="True"
                            Font-Size="13pt" Height="20px" Width="80px"></asp:TextBox>
                        <ajaxToolkit:NumericUpDownExtender ID="txtMaxResult_NumericUpDownExtender" runat="server"
                            Enabled="True" Maximum="100" Minimum="5" RefValues="" ServiceDownMethod="" ServiceDownPath=""
                            ServiceUpMethod="" Step="5" Tag="" TargetButtonDownID="" TargetButtonUpID=""
                            TargetControlID="txtMaxResult" Width="100">
                        </ajaxToolkit:NumericUpDownExtender>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="updown">
                        <asp:Label ID="Label5" runat="server" Text="Max result showed:"  
                            CssClass="updowntextbox" Font-Bold="True" Font-Size="Large"></asp:Label>
                        <asp:TextBox ID="txtMaxResultShowed"
                            runat="server" Font-Bold="True" Font-Size="13pt" Height="20px" Width="80px"></asp:TextBox>
                            <ajaxToolkit:NumericUpDownExtender ID="txtMaxResultShowed_NumericUpDownExtender"
                                runat="server" Enabled="True" Maximum="100" Minimum="5" RefValues="" ServiceDownMethod=""
                                ServiceDownPath="" ServiceUpMethod="" Step="5" Tag="" TargetButtonDownID="" TargetButtonUpID=""
                                TargetControlID="txtMaxResultShowed" Width="100">
                            </ajaxToolkit:NumericUpDownExtender>
                       
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <p style="border-bottom-style: solid; border-left-width: 5px; border-left-color: #00FF00;
            border-radius: 5px; padding-left: 5px;">
            <asp:Label ID="TimeSearch" runat="server" ForeColor="#3399FF"></asp:Label></p>
        <asp:Label ID="ResultCount" runat="server" Font-Bold="True" Font-Size="14pt" ForeColor="Blue"></asp:Label>
        <asp:DataList ID="DlResultSearch" runat="server" HorizontalAlign="Left" CellSpacing="10"
            Font-Names="Arial">
            <ItemTemplate>
                <table class="style1" cellspacing="0">
                    <tr>
                        <td>
                            <asp:HyperLink ID="HyperLink1" runat="server" Font-Size="15pt" Font-Underline="True"
                                ForeColor="Blue" NavigateUrl='<%# Eval("LinkRef") %>' Text='<%# Eval("Title") %>'></asp:HyperLink>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Title" runat="server" Font-Size="13pt" ForeColor="#33CC33" Text='<%# Eval("LinkRef") %>'></asp:Label>
                            <asp:Label ID="Label1" runat="server" Font-Size="13pt" ForeColor="#999999" Text='<%# Eval("DateModified") %>'></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Image ID="Image1" runat="server" Height="15px" ImageUrl="~/images/tag.png" Width="15px" />
                            <asp:Label ID="Tags" runat="server" Text='<%# Eval("Tags") %>' ForeColor="#999999"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label3" runat="server" Font-Bold="True" Font-Names="Arial" Font-Size="12pt"
                                ForeColor="Red" Text='<%# Eval("RankingScore","Ranking Score : {0}") %>'></asp:Label>
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
        </asp:DataList>
    </div>
    
    </td>
            </tr>
            </table>
   
    </form>
</body>
</html>
